Toggles the panel.

<div class="definition">
    toggle(type, [immediate])
</div>

<div class="arguments">
    <table>
    <tr>
        <td>type</td>
        <td><b>string</b>, name of the panel</td>
    </tr>
    <tr>
        <td>immediate</td>
        <td><b>boolean</b>, without animation (<i>optional</i>)</td>
    </tr>
    </table>
</div>

<h4>Description</h4>

If the panel is hidden the <span class="argument">toggle()</span> method will call <a href="w2layout.show">w2layout.show()</a>
method, if hidden - <a href="w2layout.show">w2layout.hide()</a>. Below is an example how to toggle a panel:
<textarea class="javascript">
let layout = new w2layout({
    name    : 'layout',
    panels  : [
        { type: 'top', size: 40 },
        { type: 'main', content: 'This is main panel' },
        { type: 'preview', size: 200 }
    ]
});

// with animation
w2ui.layout.toggle('preview');

// without animation
w2ui.layout.toggle('preview', true);
</textarea>
